package com.jyb.job;

import java.util.List;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.jyb.annotation.Scheduled;
import com.jyb.model.MyOrder;
import com.jyb.util.capture.YpcdUtil;
import com.jyb.vo.YpcdVo;

@Scheduled(fixedDelay=1000*60)
public class MyOrderJob implements Job{

	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		
		List<MyOrder> orders=MyOrder.dao.findNullCm();
		for (MyOrder myOrder : orders) {
			List<YpcdVo> vos=YpcdUtil.capture(myOrder.getStr("tdh"));
			if(vos.size()>0){
				myOrder.set("cm", vos.get(0).getCm());
				myOrder.set("hc",vos.get(0).getCc());
				myOrder.update();
			}
		}
	}

}
